Skip to content

Refactor/reduce complexity v2#402

Merged
lalit-swain-cko merged 28 commits intomasterfrom
refactor/reduce-complexity-v2
Jan 21, 2026
Merged

Refactor/reduce complexity v2#402
lalit-swain-cko merged 28 commits intomasterfrom
refactor/reduce-complexity-v2

Conversation

@lalit-swain-cko
Copy link
Collaborator

No description provided.

Lalit Swain added 26 commits January 13, 2026 18:36
- Fix workflow region validation to prevent invalid API URLs
- Add input sanitization for region settings
- Early load utility class to fix critical error on plugin activation
- Wrap debug error_log statements in WP_DEBUG checks
- Remove unnecessary debug logging from wrapper functions
- Regenerate composer autoloader without dev dependencies
- Restore README.md and languages/README.md files
- Improve production readiness and WordPress coding standards compliance
- Add validation to check API keys before SDK initialization
- Gracefully handle empty keys during initial setup/registration
- Only log SDK initialization failures when WP_DEBUG is enabled
- Fix region subdomain validation to handle 'global' value
- Use null coalescing operator for safer array access
- Update Flow webhook handler Method 3 to check both _cko_flow_payment_id and _cko_payment_id meta keys
- Add immediate order save after PayPal Express payment ID is set (before status update)
- Process pending webhooks after payment ID is saved to handle race conditions
- Update payment ID validation to check both meta keys for compatibility
- Fixes issue where PayPal Express orders (using _cko_payment_id) were not found by webhook handler
- Ensures webhooks can match orders regardless of payment method type
- Fix payment method title spacing issues on checkout page for both newer and older WooCommerce versions
- Add higher specificity CSS rules to override theme styles
- Move Terms Checkbox Guard setting to Advanced → Debug Settings
- Improve webhook/workflow duplicate detection with URL normalization
- Add auto-generated webhook/workflow names
- Enhance error messaging for multiple webhook scenarios
- Add Flow integration modules for better code organization
- Improve CSS loading order to ensure proper style precedence
…der-first checkout flow

- Remove all Reflection usage and migrate to public WooCommerce APIs
- Implement order-first checkout flow using WC()->checkout->create_order() for subscription compatibility
- Add proper WooCommerce hooks (woocommerce_checkout_order_processed, etc.)
- Fix webhook queue cleanup handler with proper error handling and redirects
- Register standalone webhook queue admin page for action handlers
- Move diagnostics to admin-only tools page (class-wc-checkoutcom-diagnostics.php)
- Remove subscription diagnostic logs
- Add Docker setup files for local development
- Fix WordPress coding standards (sanitization, capability checks, nonces)
- Remove test scripts from build (moved to admin diagnostics page)
- Remove Docker setup files from git tracking (keep locally for development)
- Add Docker files to .gitignore to prevent future commits
- Handle responses that contain extra output before JSON (e.g., '200' prefix)
- Extract JSON from response text even if plugins/server inject output
- Prevents parsererror when response is valid JSON but has leading characters
- Minimal performance impact (only runs on order creation AJAX call)
…ctions

- Prefix all Flow CSS classes with cko-flow__ (BEM naming convention)
- Prefix global functions with cko_ prefix
- Update JavaScript to use prefixed CSS classes
- Scope admin script enqueues to specific pages
- Fix CSS syntax errors and brace balance
- Remove inline styles and hardcoded headings from express checkout buttons
- Move minimal CSS to external stylesheet for theme compatibility
- Remove 'Express Checkout' headings to let themes control labels
- Unify cart page button placement - all buttons now render in shared container
- Consistent placement for Apple Pay, Google Pay, and PayPal on cart page
- Industry-standard approach: minimal plugin CSS, provider handles button styling
- Add manual sync for Flow settings (flow_component_cardholder_name_position, flow_show_card_holder_name, flow_saved_payment) in Card Settings save handler
- Normalize cardholder name position value (top/bottom/hidden) in flow-customization.js
- Only prefill cardholder name when position is not 'hidden'
- Ensures settings save correctly and pass through to Flow SDK
@lalit-swain-cko lalit-swain-cko self-assigned this Jan 20, 2026
Lalit Swain added 2 commits January 21, 2026 14:06
- Fix admin.js loading on main Payments list to hide duplicate gateways
- Update README with comprehensive upgrade guide to Flow
- Add Express Payments Apple Pay setup guide with detailed steps
- Document Card Settings and Order Settings review steps
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
D Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@lalit-swain-cko lalit-swain-cko merged commit 7b44f81 into master Jan 21, 2026
3 of 4 checks passed
@lalit-swain-cko lalit-swain-cko deleted the refactor/reduce-complexity-v2 branch January 21, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants